package com.example.test.自己的责任连;


public abstract class AbstractHandel {

    private AbstractHandel next;

    public void setNext (AbstractHandel next) {
        this.next = next;
    }


    public abstract int dohandel(int num);

    public void start(int num) {
        int res = dohandel(num);
        if ( next!=null){
            next.start(res);
        }else {
            System.out.println(res);
        }
    }

    public abstract Boolean getHandel(int n);
}
